<nav>
 	<%= tabs_tag :namespace => :sub_nav, builder: MenuTabBuilder, :open_tabs => {} do |tab| %>
		<li>
			<a herf="<%=admin_account_groups_path%>">
				<i class="fa fa-lg fa-fw fa-sitemap"></i> 
    		<span class="menu-item-parent">
    			用户分组
    		</span>
			</a>
			<% if !AccountGroup.all.blank? %>
		    <ul>
	     		<%= tab.accounts '<i class="fa fa-lg fa-fw fa-user"></i> 
						  		<span class="menu-item-parent">
						  			用户列表
						  		</span>'.html_safe, admin_accounts_path if current_admin.can?(controller: "admin/account_groups") %>
	     		<%= tab.account_groups '<i class="fa fa-lg fa-fw fa-group"></i> 
						  		<span class="menu-item-parent">
						  			分组列表
						  		</span>'.html_safe, admin_account_groups_path if current_admin.can?(controller: "admin/account_groups") %>
		    	<% AccountGroup.all.each do |account_group| %>
				 		<%= eval %{ tab.account_group_#{account_group.id} account_group.group_name, admin_accounts_path(account: {account_group: account_group.id}) } %>
		    	<% end %>
		    </ul>
	    <% end %>	
		</li>

		<li>
			<a herf="#">
				<i class="fa fa-lg fa-fw fa-bolt"></i> 
    		<span class="menu-item-parent">
    			流量策略管理
    		</span>
			</a>
			<% if !Province.all.blank? && Province.all.any?{|i| current_admin.can_see?(i) } %>
			<ul>
    	<% Province.includes(:cities).all.each do |province| %>
    		<% if current_admin.can_see?(province) %>
					<li>
						<a herf="#">
		    		<span>
		    			<%= province.name %>
		    		</span>
					</a>
					<% if !province.cities.blank? && province.cities.any?{|i| current_admin.can_see?(i) } %>
	    		<ul>
    			<% province.cities.each do |city| %>
    				<% if current_admin.can_see?(city) %>
				 		<%= eval %{ tab.traffic_strategy_city_#{city.id} city.name, admin_traffic_strategies_path(city_id: city.id) } %>
    				<% end %>
    			<% end %>
	    		</ul>
	    		<% end %>
    		</li>
    		<% end %>
    	<% end %>
	    </ul>	
	    <% end %>	
		</li>
 		<%= tab.recruitment_groups '<i class="fa fa-lg fa-fw fa-rocket"></i> 
			  		<span class="menu-item-parent">
			  			广告投放管理
			  		</span>'.html_safe, admin_recruitment_groups_path %>
 		<%= tab.blacklists '<i class="fa fa-lg fa-fw fa-thumbs-down"></i> 
			  		<span class="menu-item-parent">
			  			黑名单管理
			  		</span>'.html_safe, admin_blacklists_path %>
    <%= tab.wifi_accounts '<i class="fa fa-lg fa-fw fa-user"></i> 
            <span class="menu-item-parent">
              公共热点账号
            </span>'.html_safe, admin_wifi_accounts_path %>
	<% end %>
</nav>
